<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
	"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
	"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="cn.firstsoft.modules.portal.domain">
  <class name="Page" table="F_POR_PAGE">
  		<id name="id" type="integer">
            <column name="id" />
            <generator class="native">
            	<param name="sequence">PAGE_ID_SEQ</param>
            </generator>
        </id>
        <property name="pageCode" type="string">
            <column name="page_code" length="20" />
        </property>
        <property name="pageName" type="string">
            <column name="page_name" length="20" />
        </property>
        <property name="isEnabled" type="integer">
            <column name="is_enabled" />
        </property>
        <property name="pos" type="integer">
            <column name="pos" />
        </property>
        <property name="description" type="string">
            <column name="description" length="200" />
        </property>
        <property name="integratPath" type="string">
            <column name="integrat_path" length="200" />
        </property>
        <property name="pageType" type="integer">
            <column name="page_type" />
        </property>
        <property name="defType" type="integer">
            <column name="def_type" />
        </property>
        <property name="layoutType" type="integer">
            <column name="layout_type" />
        </property>
        <property name="isDefault" type="integer">
            <column name="is_default" />
        </property>
        <property name="nameHK" type="string">
            <column name="name_HK" length="50" />
        </property>
        <property name="nameUS" type="string">
            <column name="name_US" length="50" />
        </property>
        
        <property name="userId" type="integer">
            <column name="user_id" />
        </property>
        
        <many-to-one name="lastupdateUser" class="org.springside.modules.security.domain.User" fetch="select">
            <column name="lastupdate_user" />
        </many-to-one>
        <property name="lastupdateDate" type="java.util.Date">
            <column name="lastupdate_date" length="23" />
        </property>
		<set name="modulePages" inverse="true" cascade="all" lazy="true" order-by="pos asc">
            <key>
                <column name="page_id" not-null="true" />
            </key>
            <one-to-many class="cn.firstsoft.modules.portal.domain.ModulePage" />
        </set>
		<set name="portletPages" inverse="true" cascade="all" lazy="true" order-by="y_pos asc">
            <key>
                <column name="page_id" not-null="true" />
            </key>
            <one-to-many class="cn.firstsoft.modules.portal.domain.PortletPage" />
        </set>
        <set name="portletNewSelects" inverse="true" cascade="all" lazy="true" order-by="postion_y asc">
            <key>
                <column name="page_id" />
            </key>
            <one-to-many class="cn.firstsoft.modules.portlet.domain.PortletNewSelect" />
        </set>
        <set name="pageUsers" table="F_POR_PAGE_USER" lazy="true" inverse="false" cascade="save-update" batch-size="5">
            <key>
                <column name="page_id" not-null="true"/>
            </key>
            <many-to-many class="org.springside.modules.security.domain.User" column="user_id"/>
        </set>
        <set name="pageDepts" table="F_POR_PAGE_DEPT" lazy="true" inverse="false" cascade="save-update" batch-size="5">
            <key>
                <column name="page_id" not-null="true"/>
            </key>
            <many-to-many class="org.springside.modules.security.domain.Dept" column="dept_id"/>
        </set>
        
        <set name="portalSolutions" lazy="true" inverse="true" cascade="all">
            <key>
                <column name="page_id" />
            </key>
            <one-to-many class="cn.firstsoft.modules.portal.domain.PortalSolution" />
        </set>
  </class>
</hibernate-mapping>